home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "pwrglove.h"
-
- #define F1(x) ((x>>6)&3)
- #define F2(x) ((x>>4)&3)
- #define F3(x) ((x>>2)&3)
- #define F4(x) (x&3)
- #define HAND(x) (((x&2)>>1)|((x&8)>>2)|((x&32)>>3)|((x&128)>>4))
-
- static char gesture[16][8]={
- "Open ",
- "Dbl Gun",
- "0010 ",
- "Gun ",
- "0100 ",
- "0101 ",
- "0110 ",
- "Thumb ",
- "Three ",
- "Dbl Pnt",
- "1010 ",
- "Point ",
- "O.K. ",
- "Birdie ",
- "1110 ",
- "Fist "};
-
- void main ()
- {
- glove_data glov;
- int hand,dir;
-
- init_glove();
- while(1)
- {
- query_glove(&glov);
- hand=HAND(glov.fingers);
- printf("%s (%x) (%d,%d,%d)\n",
- gesture[hand],glov.rot,glov.x,glov.y,glov.z);
- }
- }
-